import { useDispatch, useSelector } from "./index";

import React from "react";

const ChildCount = () => {
  const dispatch = useDispatch();
  const count = useSelector((store) => store.count);

  console.log("DEMO3: re-render ChildCount", count);
  return (
    <div className="Child-container">
      <div>count is: {count}</div>
      <button onClick={() => dispatch({ type: "addCount" })}> AddCount </button>
    </div>
  );
};

export default ChildCount;
